import { createApp } from 'vue';
import pinia from '/@/stores/index';
import App from '/@/App.vue';
import router from '/@/router';
import { directive } from '/@/directive/index';
import other from '/@/utils/other';



import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import ElementPlus from 'element-plus';

import '/@/theme/index.scss';

const app = createApp(App);

app.directive('debounce', {
    mounted(el, binding) {
       
      el.addEventListener('click', e => {
        if (!el.disabled) {
            el.disabled = true
            setTimeout(() => {
                el.disabled = false
            }, binding.value || 2000)
        }
      })
    }
  })

pinia.use(piniaPluginPersistedstate)

directive(app);
other.elSvg(app);

app.use(pinia).use(router).use(ElementPlus).mount('#app');



